struct PS_INPUT
{
    float4 position : SV_Position;    // 顶点位置
    float4 worldPos : TEXCOORD9;      // 世界空间位置
    float4 color : TEXCOORD0;         // 顶点颜色
    float4 normal : TEXCOORD1;        // 法线
    float4 tangent : TEXCOORD2;       // 切线
    float4 texCoord : TEXCOORD3;      // 纹理坐标
    float3 viewDir : TEXCOORD7;       // 视线方向
    float3 lightDir : TEXCOORD8;      // 光照方向
};

#pragma warning( disable: 3556 3571 )
float float_ctor(bool x0)
{
    return float(x0);
}
float float_ctor(float x0)
{
    return float(x0);
}
float float_ctor_int(int x0)
{
    return float(x0);
}
float2 vec2_ctor(bool2 x0)
{
    return float2(x0);
}
float3 vec3_ctor(bool3 x0)
{
    return float3(x0);
}
float3 vec3_ctor(float x0)
{
    return float3(x0, x0, x0);
}
int int_ctor(float x0)
{
    return int(x0);
}
int3 ivec3_ctor(bool3 x0)
{
    return int3(x0);
}
// Uniforms

uniform float4 _CameraPosPS : register(c0);
uniform float4 _EnvInfo : register(c1);
uniform float4 _SunColor : register(c2);
uniform float4 _SunDirection : register(c3);
uniform float4 _FogColor : register(c4);
uniform float4 _ShadowColor : register(c5);
uniform float4 _ReflectionPos : register(c6);
uniform float4 _FogColor2 : register(c7);
uniform float4 _FogColor3 : register(c8);
uniform float4 _Lights0[4] : register(c9);
uniform float4 _Lights1[4] : register(c13);
uniform float4 _Lights2[4] : register(c17);
uniform float4 _UserData[3] : register(c21);
uniform float4 _cShadowBias : register(c24);
uniform float4 _cPointCloud[6] : register(c25);
uniform float4 _cParamter : register(c31);
uniform float4 _cVirtualLitDir : register(c32);
uniform float4 _cVirtualLitColor : register(c33);
uniform float _cEnvStrength : register(c34);
uniform float _cAlpha : register(c35);
uniform float4 _cEmissionScale : register(c36);
uniform float _cRoughnessX : register(c37);
uniform float _cRoughnessY : register(c38);
uniform float _cAnisotropicScale : register(c39);
uniform float _cGrayPencent : register(c40);
uniform float4 _cColorTransform0 : register(c41);
uniform float4 _cColorTransform1 : register(c42);
uniform float4 _cColorTransform2 : register(c43);
uniform float4 _cColorTransform6 : register(c44);
uniform float4 _cColorTransform7 : register(c45);
uniform float4 _cColorTransform8 : register(c46);
uniform float4 _cColorTransform9 : register(c47);
uniform float4 _cColorTransform10 : register(c48);
uniform float4 _cColorTransform11 : register(c49);
uniform float4 _cDyeRampPosition : register(c50);
uniform float _cAlphaStart : register(c51);
uniform float _cAlphaEnd : register(c52);
uniform float _cAlphaStartTime : register(c53);
uniform float _cAlphaBlendTime : register(c54);
uniform float _cSpecInt : register(c55);
uniform float3 _cSpec01Color : register(c56);
uniform float3 _cSpec02Color : register(c57);
uniform float _cMultipleColorsRampEnable : register(c58);
uniform float _cDyeHairIntensity : register(c59);
uniform float3 _cGrayHairColor : register(c60);
uniform float _cGrayHairFlag : register(c61);
uniform float _eDissipatedEffect : register(c62);
uniform float _eControl : register(c63);
uniform float _eDissipatedEmissionControl : register(c64);
uniform float _eDissipatedBaseControl : register(c65);
uniform float _eDissipatedEdgeEmissionIntensity : register(c66);
uniform float3 _eDissipatedEdgeEmissionColor : register(c67);
uniform float _eDissipatedEdgeBaseColorAlpha : register(c68);
uniform float3 _eDissipatedEdgeBaseColor : register(c69);
uniform float _eDissipatedEmissionSoftness : register(c70);
uniform float _eDissipatedEmissionEdge : register(c71);
uniform float _eDissipatedBaseSoftness : register(c72);
uniform float _eDissipatedBaseEdge : register(c73);
uniform float4 _eDissipatedUVScrolling : register(c74);
uniform float4 _eDissipatedNoiseUVScrolling : register(c75);
uniform float _eDissipatedNoiseStrength : register(c76);
uniform float _eAlpha : register(c77);
uniform float _eDissipatedInvert : register(c78);
uniform float _eDissipatedUseNormal : register(c79);
uniform float _cGrayMetallicoffset : register(c80);
uniform float _eDissipatedHeightMix : register(c81);
uniform float _eDissipatedHeightScale : register(c82);
uniform float _eDissipateHeightOffset : register(c83);
uniform float _cNewBloomScale : register(c84);
uniform float _eFresnelEffect : register(c85);
uniform float _eFresnelPower : register(c86);
uniform float _eFresnelMinIntensity : register(c87);
uniform float3 _eFresnelColor : register(c88);
uniform float _eFresnelColorInt : register(c89);
uniform float _eFresnelBreathMinLum : register(c90);
uniform float _eFresnelBreathFreq : register(c91);
uniform float _eFresnelOnlyEmission : register(c92);
uniform float _cNewHairSpec : register(c93);
uniform float _cHairBaseInt : register(c94);
uniform float _eIceEffect : register(c95);
uniform float _eIceStartRatio : register(c96);
uniform float _eIceControl : register(c97);
uniform float _eIceHeightLow : register(c98);
uniform float _eIceHeightHigh : register(c99);
uniform float _eIceHeightBlend : register(c100);
uniform float _eIceDetailScale : register(c101);
uniform float _eIceEdgeSoft : register(c102);
uniform float3 _eIceColorBase : register(c103);
uniform float _eIceColorBaseIns : register(c104);
uniform float3 _eIceColorEdge : register(c105);
uniform float _eIceColorEdgeIns : register(c106);
uniform float4 _eIceUVScrolling : register(c107);
uniform float4 _cDyeingEmissionInt : register(c108);
uniform float4 _cNewDyePosAndSoft : register(c109);
uniform float _cNewDyeingMultipleColor : register(c110);
uniform float _eFresnelFadeUVFlag : register(c111);
uniform float3 _eFresnelFadeCenter : register(c112);
uniform float _eFresnelFadeTargetRadius : register(c113);
uniform float _eFresnelFade : register(c114);
uniform float _eFresnelFadePower : register(c115);
static const uint _sBaseSampler = 0;
static const uint _sMixSampler = 1;
static const uint _sNormalSampler = 2;
static const uint _sEnvSampler = 3;
static const uint _sShadowMapSampler = 4;
static const uint _sEffectMapSampler = 5;
uniform Texture2D<float4> textures2D[6] : register(t0);
uniform SamplerState samplers2D[6] : register(s0);
#ifdef ANGLE_ENABLE_LOOP_FLATTEN
#define LOOP [loop]
#define FLATTEN [flatten]
#else
#define LOOP
#define FLATTEN
#endif

#define ATOMIC_COUNTER_ARRAY_STRIDE 4

// Varyings
static  float4 _xlv_TEXCOORD0 = {0, 0, 0, 0};
static  float4 _xlv_TEXCOORD1 = {0, 0, 0, 0};
static  float4 _xlv_TEXCOORD2 = {0, 0, 0, 0};
static  float4 _xlv_TEXCOORD3 = {0, 0, 0, 0};
static  float4 _xlv_TEXCOORD4 = {0, 0, 0, 0};
static  float3 _xlv_TEXCOORD5 = {0, 0, 0};
static  float3 _xlv_TEXCOORD6 = {0, 0, 0};
static  float4 _xlv_TEXCOORD7 = {0, 0, 0, 0};
static  float4 _xlv_TEXCOORD8 = {0, 0, 0, 0};

static float4 out_SV_Target = {0, 0, 0, 0};

cbuffer DriverConstants : register(b1)
{
    struct SamplerMetadata
    {
        int baseLevel;
        int internalFormatBits;
        int wrapModes;
        int padding;
        int4 intBorderColor;
    };
    SamplerMetadata samplerMetadata[6] : packoffset(c4);
};

float4 gl_texture2D(uint samplerIndex, float2 t)
{
    return textures2D[samplerIndex].Sample(samplers2D[samplerIndex], float2(t.x, t.y));
}

float4 gl_texture2D(uint samplerIndex, float2 t, float bias)
{
    return textures2D[samplerIndex].SampleBias(samplers2D[samplerIndex], float2(t.x, t.y), bias);
}

float4 gl_texture2DLod(uint samplerIndex, float2 t, float lod)
{
    return textures2D[samplerIndex].SampleLevel(samplers2D[samplerIndex], float2(t.x, t.y), lod);
}

float mod_emu(float x, float y)
{
    return x - y * floor(x / y);
}


struct PS_OUTPUT
{
    float4 out_SV_Target : SV_TARGET0;
};

PS_OUTPUT generateOutput()
{
    PS_OUTPUT output;
    output.out_SV_Target = out_SV_Target;
    return output;
}


PS_OUTPUT main(PS_INPUT input){
    _xlv_TEXCOORD0 = input.color;
    _xlv_TEXCOORD1 = input.normal;
    _xlv_TEXCOORD2 = input.tangent;
    _xlv_TEXCOORD3 = input.texCoord;
    _xlv_TEXCOORD4 = input.position;
    _xlv_TEXCOORD7 = input.viewDir;
    _xlv_TEXCOORD8 = input.lightDir;
    _xlv_TEXCOORD5 = input.viewDir.xyz;
    _xlv_TEXCOORD6 = input.lightDir.xyz;

float _SunlightOffset_13190 = {0};
float3 _diffLighting_23191 = {0, 0, 0};
float3 _R_33192 = {0, 0, 0};
float3 _SpecularColor_43193 = {0, 0, 0};
float3 _DiffuseColor_53194 = {0, 0, 0};
float2 _inRange_63195 = {0, 0};
float _shadow2_73196 = {0};
float _shadow_83197 = {0};
float _Alpha_93198 = {0};
float4 _GILighting_103199 = {0, 0, 0, 0};
float4 _Emission_113200 = {0, 0, 0, 0};
float _Roughness_123201 = {0};
float3 _BaseColor_133202 = {0, 0, 0};
float4 _OUT_143203 = {0, 0, 0, 0};
(_OUT_143203 = float4(0.0, 0.0, 0.0, 0.0));
(_BaseColor_133202 = float3(1.0, 1.0, 1.0));
(_Roughness_123201 = 0.30000001);
(_Emission_113200 = float4(0.0, 0.0, 0.0, 1.0));
(_GILighting_103199 = float4(0.0, 0.0, 0.0, 1.0));
(_Alpha_93198 = 1.0);
float3 _BaseColor_153204 = {0, 0, 0};
float _Roughness_163205 = {0};
float3 _N_173206 = {0, 0, 0};
float4 _Emission_183207 = {0, 0, 0, 0};
float4 _GILighting_193208 = {0, 0, 0, 0};
float _Alpha_203209 = {0};
float3 _Spec02Color_213210 = {0, 0, 0};
float3 _Spec01Color_223211 = {0, 0, 0};
float3 _virtualRadiance_233212 = {0, 0, 0};
float _virtualAniso_243213 = {0};
float _directAniso_253214 = {0};
float3 _inputRadiance_263215 = {0, 0, 0};
float _VirtualLitNoL_273216 = {0};
float _NoL_283217 = {0};
float3 _V_293218 = {0, 0, 0};
float _RoughnessY_303219 = {0};
float _RoughnessX_313220 = {0};
float3 _tangentNormal_323221 = {0, 0, 0};
float3 _DyeingEmission_333222 = {0, 0, 0};
float _AO_343223 = {0};
float4 _base_color_data_353224 = {0, 0, 0, 0};
float4 _color_363225 = {0, 0, 0, 0};
(_color_363225 = gl_texture2D(_sBaseSampler, _xlv_TEXCOORD0.xy, -1.0));
(_BaseColor_153204 = ((_color_363225.xyz * _color_363225.xyz) * _cHairBaseInt));
(_Alpha_203209 = (_cAlpha * _color_363225.w));
float4 _tmpvar_373226 = {0, 0, 0, 0};
(_tmpvar_373226.w = 1.0);
(_tmpvar_373226.xyz = _BaseColor_153204);
(_base_color_data_353224 = _tmpvar_373226);
float4 _color_383227 = {0, 0, 0, 0};
(_color_383227 = gl_texture2D(_sMixSampler, _xlv_TEXCOORD0.xy));
(_AO_343223 = _color_383227.z);
float _rr_393228 = {0};
float _tmpvar_403229 = {0};
(_tmpvar_403229 = (_EnvInfo.x * 0.5));
(_rr_393228 = _tmpvar_403229);
float _tmpvar_413230 = {0};
(_tmpvar_413230 = clamp((((3.0 * _xlv_TEXCOORD2.y) + 0.2) + (0.1 * _rr_393228)), 0.0, 1.0));
(_rr_393228 = (_rr_393228 * _tmpvar_413230));
(_Roughness_163205 = (((1.0 - _rr_393228) * (1.0 - _color_383227.x)) + (0.050000001 * _color_383227.x)));
float _tmpvar_423231 = {0};
(_tmpvar_423231 = clamp((_color_383227.y - _cGrayMetallicoffset), 0.0, 1.0));
float _tmpvar_433232 = {0};
(_tmpvar_433232 = clamp((_color_383227.y - _cGrayMetallicoffset), 0.0, 1.0));
(_BaseColor_153204 = ((_BaseColor_153204 * (1.0 - ((1.0 - _tmpvar_423231) * _cGrayHairFlag))) + (_cGrayHairColor * ((1.0 - _tmpvar_433232) * _cGrayHairFlag))));
(_DyeingEmission_333222 = float3(0.0, 0.0, 0.0));
if ((_cGrayHairFlag < 0.99989998))
{
if ((_cMultipleColorsRampEnable > 0.5))
{
float _mask_443233 = {0};
float3 _DyeEmissionCol2_453234 = {0, 0, 0};
float3 _DyeEmissionCol1_463235 = {0, 0, 0};
float3 _DyeEmissionCol0_473236 = {0, 0, 0};
float3 _hairDyeColor2_483237 = {0, 0, 0};
float3 _hairDyeColor1_493238 = {0, 0, 0};
float3 _hairDyeColor0_503239 = {0, 0, 0};
float3 _tmpvar_513240 = {0, 0, 0};
(_tmpvar_513240.x = dot(_cColorTransform0, float4(1.0, 1.0, 1.0, 1.0)));
(_tmpvar_513240.y = dot(_cColorTransform1, float4(1.0, 1.0, 1.0, 1.0)));
(_tmpvar_513240.z = dot(_cColorTransform2, float4(1.0, 1.0, 1.0, 1.0)));
float3 _tmpvar_523241 = {0, 0, 0};
(_tmpvar_523241 = clamp(_tmpvar_513240, 0.0, 1.0));
(_hairDyeColor0_503239 = _tmpvar_523241);
float3 _tmpvar_533242 = {0, 0, 0};
(_tmpvar_533242.x = dot(_cColorTransform6, float4(1.0, 1.0, 1.0, 1.0)));
(_tmpvar_533242.y = dot(_cColorTransform7, float4(1.0, 1.0, 1.0, 1.0)));
(_tmpvar_533242.z = dot(_cColorTransform8, float4(1.0, 1.0, 1.0, 1.0)));
float3 _tmpvar_543243 = {0, 0, 0};
(_tmpvar_543243 = clamp(_tmpvar_533242, 0.0, 1.0));
(_hairDyeColor1_493238 = _tmpvar_543243);
float3 _tmpvar_553244 = {0, 0, 0};
(_tmpvar_553244.x = dot(_cColorTransform9, float4(1.0, 1.0, 1.0, 1.0)));
(_tmpvar_553244.y = dot(_cColorTransform10, float4(1.0, 1.0, 1.0, 1.0)));
(_tmpvar_553244.z = dot(_cColorTransform11, float4(1.0, 1.0, 1.0, 1.0)));
float3 _tmpvar_563245 = {0, 0, 0};
(_tmpvar_563245 = clamp(_tmpvar_553244, 0.0, 1.0));
(_hairDyeColor2_483237 = _tmpvar_563245);
float3 _tmpvar_573246 = {0, 0, 0};
(_tmpvar_573246 = (_hairDyeColor0_503239 * _cDyeingEmissionInt.x));
(_DyeEmissionCol0_473236 = _tmpvar_573246);
float3 _tmpvar_583247 = {0, 0, 0};
(_tmpvar_583247 = (_hairDyeColor1_493238 * _cDyeingEmissionInt.y));
(_DyeEmissionCol1_463235 = _tmpvar_583247);
float3 _tmpvar_593248 = {0, 0, 0};
(_tmpvar_593248 = (_hairDyeColor2_483237 * _cDyeingEmissionInt.z));
(_DyeEmissionCol2_453234 = _tmpvar_593248);
float _tmpvar_603249 = {0};
(_tmpvar_603249 = _xlv_TEXCOORD0.w);
(_mask_443233 = _tmpvar_603249);
if ((_cNewDyeingMultipleColor > 0.80000001))
{
float _soft1_613250 = {0};
float _soft0_623251 = {0};
float _pos1_633252 = {0};
float _pos0_643253 = {0};
float _tmpvar_653254 = {0};
(_tmpvar_653254 = _cNewDyePosAndSoft.x);
(_pos0_643253 = _tmpvar_653254);
float _tmpvar_663255 = {0};
(_tmpvar_663255 = _cNewDyePosAndSoft.y);
(_pos1_633252 = _tmpvar_663255);
float _tmpvar_673256 = {0};
(_tmpvar_673256 = _cNewDyePosAndSoft.z);
(_soft0_623251 = _tmpvar_673256);
float _tmpvar_683257 = {0};
(_tmpvar_683257 = _cNewDyePosAndSoft.w);
(_soft1_613250 = _tmpvar_683257);
float _tmpvar_693258 = {0};
float _edge0_703259 = {0};
(_edge0_703259 = (_pos0_643253 - _soft0_623251));
float _tmpvar_713260 = {0};
(_tmpvar_713260 = clamp(((_mask_443233 - _edge0_703259) / ((_pos0_643253 + _soft0_623251) - _edge0_703259)), 0.0, 1.0));
(_tmpvar_693258 = (_tmpvar_713260 * (_tmpvar_713260 * (3.0 - (2.0 * _tmpvar_713260)))));
(_BaseColor_153204 = ((_hairDyeColor0_503239 * (1.0 - _tmpvar_693258)) + (_hairDyeColor1_493238 * _tmpvar_693258)));
(_DyeingEmission_333222 = ((_DyeEmissionCol0_473236 * (1.0 - _tmpvar_693258)) + (_DyeEmissionCol1_463235 * _tmpvar_693258)));
float _tmpvar_723261 = {0};
float _edge0_733262 = {0};
(_edge0_733262 = (_pos1_633252 - _soft1_613250));
float _tmpvar_743263 = {0};
(_tmpvar_743263 = clamp(((_mask_443233 - _edge0_733262) / ((_pos1_633252 + _soft1_613250) - _edge0_733262)), 0.0, 1.0));
(_tmpvar_723261 = (_tmpvar_743263 * (_tmpvar_743263 * (3.0 - (2.0 * _tmpvar_743263)))));
(_BaseColor_153204 = ((_BaseColor_153204 * (1.0 - _tmpvar_723261)) + (_hairDyeColor2_483237 * _tmpvar_723261)));
(_DyeingEmission_333222 = ((_DyeingEmission_333222 * (1.0 - _tmpvar_723261)) + (_DyeEmissionCol2_453234 * _tmpvar_723261)));
}
else
{
float _pos2_753264 = {0};
float _pos1_763265 = {0};
float _pos0_773266 = {0};
float _tmpvar_783267 = {0};
(_tmpvar_783267 = _cDyeRampPosition.x);
(_pos0_773266 = _tmpvar_783267);
float _tmpvar_793268 = {0};
(_tmpvar_793268 = _cDyeRampPosition.y);
(_pos1_763265 = _tmpvar_793268);
float _tmpvar_803269 = {0};
(_tmpvar_803269 = _cDyeRampPosition.z);
(_pos2_753264 = _tmpvar_803269);
float _tmpvar_813270 = {0};
(_tmpvar_813270 = float_ctor((_pos1_763265 >= _mask_443233)));
float _tmpvar_823271 = {0};
(_tmpvar_823271 = ((_pos0_773266 * _tmpvar_813270) + (_pos1_763265 * (1.0 - _tmpvar_813270))));
float _tmpvar_833272 = {0};
float _tmpvar_843273 = {0};
(_tmpvar_843273 = clamp(((_mask_443233 - _tmpvar_823271) / (((_pos1_763265 * _tmpvar_813270) + (_pos2_753264 * (1.0 - _tmpvar_813270))) - _tmpvar_823271)), 0.0, 1.0));
(_tmpvar_833272 = (_tmpvar_843273 * (_tmpvar_843273 * (3.0 - (2.0 * _tmpvar_843273)))));
(_BaseColor_153204 = ((((_hairDyeColor0_503239 * _tmpvar_813270) + (_hairDyeColor1_493238 * (1.0 - _tmpvar_813270))) * (1.0 - _tmpvar_833272)) + (((_hairDyeColor1_493238 * _tmpvar_813270) + (_hairDyeColor2_483237 * (1.0 - _tmpvar_813270))) * _tmpvar_833272)));
}
float3 _tmpvar_853274 = {0, 0, 0};
bool _tmpvar_863275 = {0};
(_tmpvar_863275 = (0.89999998 >= _xlv_TEXCOORD0.z));
(_tmpvar_853274 = ((_base_color_data_353224.xyz * (1.0 - float_ctor(_tmpvar_863275))) + (_BaseColor_153204 * float_ctor(_tmpvar_863275))));
(_BaseColor_153204 = _tmpvar_853274);
float3 _tmpvar_873276 = {0, 0, 0};
(_tmpvar_873276 = ((_base_color_data_353224.xyz * (1.0 - _cDyeHairIntensity)) + (_BaseColor_153204 * _cDyeHairIntensity)));
(_BaseColor_153204 = _tmpvar_873276);
float3 _tmpvar_883277 = {0, 0, 0};
(_tmpvar_883277 = _BaseColor_153204);
(_BaseColor_153204 = _tmpvar_883277);
}
else
{
float3 _tmpvar_893278 = {0, 0, 0};
(_tmpvar_893278 = _BaseColor_153204);
(_BaseColor_153204 = _tmpvar_893278);
(_DyeingEmission_333222 = float3(0.0, 0.0, 0.0));
float3 _tmpvar_903279 = {0, 0, 0};
(_tmpvar_903279 = _BaseColor_153204);
(_BaseColor_153204 = _tmpvar_903279);
}
}
(_tangentNormal_323221 = ((2.0 * gl_texture2D(_sNormalSampler, _xlv_TEXCOORD0.xy, -0.5).xyz) - 1.0));
(_tangentNormal_323221.xy = (_tangentNormal_323221.xy * (_cParamter.w * _cParamter.w)));
(_N_173206 = (((_tangentNormal_323221.x * _xlv_TEXCOORD5) + (_tangentNormal_323221.y * _xlv_TEXCOORD6)) + (_tangentNormal_323221.z * _xlv_TEXCOORD2.xyz)));
float3 _tmpvar_913280 = {0, 0, 0};
(_tmpvar_913280 = normalize(_N_173206));
(_N_173206 = _tmpvar_913280);
float4 _tmpvar_923281 = {0, 0, 0, 0};
(_tmpvar_923281.xyz = float3(0.0, 0.0, 0.0));
(_tmpvar_923281.w = _cEmissionScale.w);
(_Emission_183207 = _tmpvar_923281);
float _tmpvar_933282 = {0};
(_tmpvar_933282 = ((_cRoughnessX * _Roughness_163205) + 1e-06));
(_RoughnessX_313220 = _tmpvar_933282);
float _tmpvar_943283 = {0};
(_tmpvar_943283 = ((_cRoughnessY * _Roughness_163205) + 1e-06));
(_RoughnessY_303219 = _tmpvar_943283);
float3 _tmpvar_953284 = {0, 0, 0};
(_tmpvar_953284 = normalize((-_xlv_TEXCOORD3.xyz)));
(_V_293218 = _tmpvar_953284);
float _tmpvar_963285 = {0};
(_tmpvar_963285 = clamp(dot(_tmpvar_913280, _SunDirection.xyz), 0.0, 1.0));
(_NoL_283217 = _tmpvar_963285);
float _tmpvar_973286 = {0};
(_tmpvar_973286 = max(0.001, dot(_tmpvar_913280, _V_293218)));
(_VirtualLitNoL_273216 = _tmpvar_973286);
if ((_cNewHairSpec > 0.80000001))
{
float _tmpvar_983287 = {0};
(_tmpvar_983287 = clamp(((dot(_tmpvar_913280, _SunDirection.xyz) * 0.5) + 0.5), 0.0, 1.0));
(_NoL_283217 = _tmpvar_983287);
}
float3 _tmpvar_993288 = {0, 0, 0};
(_tmpvar_993288 = (_SunColor * _NoL_283217).xyz);
(_inputRadiance_263215 = _tmpvar_993288);
(_directAniso_253214 = 0.0);
(_virtualAniso_243213 = 0.0);
(_inputRadiance_263215 = (_inputRadiance_263215 * _cPointCloud[0].w));
float3 _tmpvar_1003289 = {0, 0, 0};
(_tmpvar_1003289 = (((_VirtualLitNoL_273216 * _cVirtualLitColor.xyz) * _UserData[1].z) * 2.0));
(_virtualRadiance_233212 = _tmpvar_1003289);
(_Spec01Color_223211 = float3(1.0, 1.0, 1.0));
(_Spec02Color_213210 = float3(1.0, 1.0, 1.0));
if ((_cGrayHairFlag < 0.99989998))
{
(_Spec01Color_223211 = _cSpec01Color);
(_Spec02Color_213210 = _cSpec02Color);
}
float3 _L_1013290 = {0, 0, 0};
(_L_1013290 = _SunDirection.xyz);
float3 _N_1023291 = {0, 0, 0};
(_N_1023291 = _tmpvar_913280);
float3 _Tangent_1033292 = {0, 0, 0};
(_Tangent_1033292 = _xlv_TEXCOORD5);
float3 _Binormal_1043293 = {0, 0, 0};
(_Binormal_1043293 = _xlv_TEXCOORD6);
float _aniso_1053294 = {0};
float2 _beta_1063295 = {0, 0};
float3 _x_1073296 = {0, 0, 0};
(_x_1073296 = (_L_1013290 + _V_293218));
float3 _tmpvar_1083297 = {0, 0, 0};
(_tmpvar_1083297 = ((_L_1013290 + _V_293218) / max(0.001, sqrt(dot(_x_1073296, _x_1073296)))));
float2 _tmpvar_1093298 = {0, 0};
(_tmpvar_1093298.x = (dot(_tmpvar_1083297, _Tangent_1033292) / _RoughnessX_313220));
(_tmpvar_1093298.y = (dot(_tmpvar_1083297, _Binormal_1043293) / _RoughnessY_303219));
(_beta_1063295 = _tmpvar_1093298);
(_beta_1063295 = (_beta_1063295 * _beta_1063295));
float _tmpvar_1103299 = {0};
(_tmpvar_1103299 = max(0.001, (((314.1593 * _RoughnessX_313220) * _RoughnessY_303219) * sqrt((_NoL_283217 * max(0.001, dot(_V_293218, _N_1023291)))))));
float _tmpvar_1113300 = {0};
(_tmpvar_1113300 = max(0.0099999998, (0.5 + (0.5 * dot(_tmpvar_1083297, _N_1023291)))));
float _tmpvar_1123301 = {0};
(_tmpvar_1123301 = (exp(((-(_beta_1063295.x + _beta_1063295.y)) / _tmpvar_1113300)) / _tmpvar_1103299));
(_aniso_1053294 = _tmpvar_1123301);
(_directAniso_253214 = (_cAnisotropicScale * _aniso_1053294));
float3 _N_1133302 = {0, 0, 0};
(_N_1133302 = _tmpvar_913280);
float3 _Tangent_1143303 = {0, 0, 0};
(_Tangent_1143303 = _xlv_TEXCOORD5);
float3 _Binormal_1153304 = {0, 0, 0};
(_Binormal_1153304 = _xlv_TEXCOORD6);
float _aniso_1163305 = {0};
float2 _beta_1173306 = {0, 0};
float3 _x_1183307 = {0, 0, 0};
(_x_1183307 = (_V_293218 + _V_293218));
float3 _tmpvar_1193308 = {0, 0, 0};
(_tmpvar_1193308 = ((_V_293218 + _V_293218) / max(0.001, sqrt(dot(_x_1183307, _x_1183307)))));
float2 _tmpvar_1203309 = {0, 0};
(_tmpvar_1203309.x = (dot(_tmpvar_1193308, _Tangent_1143303) / _RoughnessX_313220));
(_tmpvar_1203309.y = (dot(_tmpvar_1193308, _Binormal_1153304) / _RoughnessY_303219));
(_beta_1173306 = _tmpvar_1203309);
(_beta_1173306 = (_beta_1173306 * _beta_1173306));
float _tmpvar_1213310 = {0};
(_tmpvar_1213310 = max(0.001, (((314.1593 * _RoughnessX_313220) * _RoughnessY_303219) * sqrt((_VirtualLitNoL_273216 * max(0.001, dot(_V_293218, _N_1133302)))))));
float _tmpvar_1223311 = {0};
(_tmpvar_1223311 = max(0.0099999998, (0.5 + (0.5 * dot(_tmpvar_1193308, _N_1133302)))));
float _tmpvar_1233312 = {0};
(_tmpvar_1233312 = (exp(((-(_beta_1173306.x + _beta_1173306.y)) / _tmpvar_1223311)) / _tmpvar_1213310));
(_aniso_1163305 = _tmpvar_1233312);
(_virtualAniso_243213 = (_cAnisotropicScale * _aniso_1163305));
(_Emission_183207.xyz = (((_Spec01Color_223211 * _inputRadiance_263215) * (_directAniso_253214 * _cSpecInt)) * ((_BaseColor_153204 * 0.80000001) + 0.2)));
(_BaseColor_153204 = (_BaseColor_153204 + (((_Spec02Color_213210 * _virtualRadiance_233212) * ((_virtualAniso_243213 * _color_383227.z) * _cSpecInt)) * ((_BaseColor_153204 * 0.80000001) + 0.2))));
(_BaseColor_153204 = min(_BaseColor_153204, 10.0));
(_Emission_183207.xyz = (_Emission_183207.xyz * (_color_383227.z * _Alpha_203209)));
(_Emission_183207.xyz = (_Emission_183207.xyz + _DyeingEmission_333222));
(_Emission_183207.xyz = min(_Emission_183207.xyz, 10.0));
float4 _linearColor_1243313 = {0, 0, 0, 0};
float3 _nSquared_1253314 = {0, 0, 0};
float3 _tmpvar_1263315 = {0, 0, 0};
(_tmpvar_1263315 = (_tmpvar_913280 * _tmpvar_913280));
(_nSquared_1253314 = _tmpvar_1263315);
int3 _tmpvar_1273316 = {0, 0, 0};
(_tmpvar_1273316 = ivec3_ctor((_tmpvar_913280 < float3(0.0, 0.0, 0.0))));
float4 _tmpvar_1283317 = {0, 0, 0, 0};
if ((_tmpvar_1273316.x < 2))
{
float4 _tmpvar_1293318 = {0, 0, 0, 0};
if ((_tmpvar_1273316.x == 0))
{
(_tmpvar_1293318 = _cPointCloud[0]);
}
else
{
(_tmpvar_1293318 = _cPointCloud[1]);
}
(_tmpvar_1283317 = _tmpvar_1293318);
}
else
{
if ((_tmpvar_1273316.x < 4))
{
float4 _tmpvar_1303319 = {0, 0, 0, 0};
if ((_tmpvar_1273316.x == 2))
{
(_tmpvar_1303319 = _cPointCloud[2]);
}
else
{
(_tmpvar_1303319 = _cPointCloud[3]);
}
(_tmpvar_1283317 = _tmpvar_1303319);
}
else
{
float4 _tmpvar_1313320 = {0, 0, 0, 0};
if ((_tmpvar_1273316.x == 4))
{
(_tmpvar_1313320 = _cPointCloud[4]);
}
else
{
(_tmpvar_1313320 = _cPointCloud[5]);
}
(_tmpvar_1283317 = _tmpvar_1313320);
}
}
int _idx_1323321 = {0};
(_idx_1323321 = (_tmpvar_1273316.y + 2));
float4 _tmpvar_1333322 = {0, 0, 0, 0};
if ((_idx_1323321 < 2))
{
float4 _tmpvar_1343323 = {0, 0, 0, 0};
if ((_idx_1323321 == 0))
{
(_tmpvar_1343323 = _cPointCloud[0]);
}
else
{
(_tmpvar_1343323 = _cPointCloud[1]);
}
(_tmpvar_1333322 = _tmpvar_1343323);
}
else
{
if ((_idx_1323321 < 4))
{
float4 _tmpvar_1353324 = {0, 0, 0, 0};
if ((_idx_1323321 == 2))
{
(_tmpvar_1353324 = _cPointCloud[2]);
}
else
{
(_tmpvar_1353324 = _cPointCloud[3]);
}
(_tmpvar_1333322 = _tmpvar_1353324);
}
else
{
float4 _tmpvar_1363325 = {0, 0, 0, 0};
if ((_idx_1323321 == 4))
{
(_tmpvar_1363325 = _cPointCloud[4]);
}
else
{
(_tmpvar_1363325 = _cPointCloud[5]);
}
(_tmpvar_1333322 = _tmpvar_1363325);
}
}
int _idx_1373326 = {0};
(_idx_1373326 = (_tmpvar_1273316.z + 4));
float4 _tmpvar_1383327 = {0, 0, 0, 0};
if ((_idx_1373326 < 2))
{
float4 _tmpvar_1393328 = {0, 0, 0, 0};
if ((_idx_1373326 == 0))
{
(_tmpvar_1393328 = _cPointCloud[0]);
}
else
{
(_tmpvar_1393328 = _cPointCloud[1]);
}
(_tmpvar_1383327 = _tmpvar_1393328);
}
else
{
if ((_idx_1373326 < 4))
{
float4 _tmpvar_1403329 = {0, 0, 0, 0};
if ((_idx_1373326 == 2))
{
(_tmpvar_1403329 = _cPointCloud[2]);
}
else
{
(_tmpvar_1403329 = _cPointCloud[3]);
}
(_tmpvar_1383327 = _tmpvar_1403329);
}
else
{
float4 _tmpvar_1413330 = {0, 0, 0, 0};
if ((_idx_1373326 == 4))
{
(_tmpvar_1413330 = _cPointCloud[4]);
}
else
{
(_tmpvar_1413330 = _cPointCloud[5]);
}
(_tmpvar_1383327 = _tmpvar_1413330);
}
}
float4 _tmpvar_1423331 = {0, 0, 0, 0};
(_tmpvar_1423331 = (((_nSquared_1253314.x * _tmpvar_1283317) + (_nSquared_1253314.y * _tmpvar_1333322)) + (_nSquared_1253314.z * _tmpvar_1383327)));
(_linearColor_1243313 = _tmpvar_1423331);
(_linearColor_1243313.xyz = max(float3(0.89999998, 0.89999998, 0.89999998), _linearColor_1243313.xyz));
float3 _tmpvar_1433332 = {0, 0, 0};
(_tmpvar_1433332 = vec3_ctor((_ShadowColor.x * (10.0 + ((_cPointCloud[3].w * _ShadowColor.z) * 100.0)))));
(_linearColor_1243313.xyz = (_linearColor_1243313.xyz * _tmpvar_1433332));
(_GILighting_193208.xyz = _linearColor_1243313.xyz);
(_GILighting_193208.w = _AO_343223);
float _alpha_1443333 = {0};
(_alpha_1443333 = _Alpha_203209);
float _tmpvar_1453334 = {0};
if (((_cAlphaStart != 1.0) || (_cAlphaEnd != 1.0)))
{
float _tmpvar_1463335 = {0};
(_tmpvar_1463335 = (_CameraPosPS.w - _cAlphaStartTime));
(_tmpvar_1453334 = (_alpha_1443333 * ((_cAlphaStart * (1.0 - clamp((_tmpvar_1463335 / _cAlphaBlendTime), 0.0, 1.0))) + (_cAlphaEnd * clamp((_tmpvar_1463335 / _cAlphaBlendTime), 0.0, 1.0)))));
}
else
{
(_tmpvar_1453334 = _alpha_1443333);
}
(_Alpha_203209 = _tmpvar_1453334);
(_BaseColor_133202 = _BaseColor_153204);
(_Roughness_123201 = _Roughness_163205);
(_Emission_113200 = _Emission_183207);
(_GILighting_103199 = _GILighting_193208);
(_Alpha_93198 = _Alpha_203209);
float3 _Emission_1473336 = {0, 0, 0};
(_Emission_1473336 = _Emission_183207.xyz);
float3 _BaseColor_1483337 = {0, 0, 0};
(_BaseColor_1483337 = _BaseColor_153204);
float _Alpha_1493338 = {0};
(_Alpha_1493338 = _Alpha_203209);
float _Roughness_1503339 = {0};
(_Roughness_1503339 = _Roughness_163205);
float4 _Extra_1513340 = {0, 0, 0, 0};
(_Extra_1513340 = float4(0.0, 0.0, 0.0, 0.0));
if ((_eDissipatedEffect == 1.0))
{
float _alphaRef_1523341 = {0};
(_alphaRef_1523341 = (_Alpha_1493338 * _eAlpha));
float _ControlValue_1533342 = {0};
(_ControlValue_1533342 = (_eDissipatedEmissionControl + _eControl));
float _dissipatedControl_1543343 = {0};
float _alpha_1553344 = {0};
float _dNoise_1563345 = {0};
float2 _dissipateTC_1573346 = {0, 0};
float _tmpvar_1583347 = {0};
float _tmpvar_1593348 = {0};
float2 _tmpvar_1603349 = {0, 0};
(_tmpvar_1603349 = ((_xlv_TEXCOORD0.xy * _eDissipatedUVScrolling.xy) + (_CameraPosPS.w * _eDissipatedUVScrolling.zw)));
(_dissipateTC_1573346 = _tmpvar_1603349);
float2 _tmpvar_1613350 = {0, 0};
(_tmpvar_1613350 = ((_xlv_TEXCOORD0.xy * _eDissipatedNoiseUVScrolling.xy) + (_CameraPosPS.w * _eDissipatedNoiseUVScrolling.zw)));
(_dNoise_1563345 = 0.0);
(_alpha_1553344 = 0.0);
if ((_eDissipatedUseNormal == 1.0))
{
float4 _tmpvar_1623351 = {0, 0, 0, 0};
(_tmpvar_1623351 = gl_texture2D(_sNormalSampler, _tmpvar_1613350));
(_dNoise_1563345 = (_tmpvar_1623351.y * _eDissipatedNoiseStrength));
(_dissipateTC_1573346 = (_tmpvar_1603349 + _dNoise_1563345));
float4 _tmpvar_1633352 = {0, 0, 0, 0};
(_tmpvar_1633352 = gl_texture2D(_sNormalSampler, _dissipateTC_1573346));
(_alpha_1553344 = _tmpvar_1633352.x);
}
else
{
float4 _tmpvar_1643353 = {0, 0, 0, 0};
(_tmpvar_1643353 = gl_texture2D(_sEffectMapSampler, _tmpvar_1613350));
(_dNoise_1563345 = (_tmpvar_1643353.y * _eDissipatedNoiseStrength));
(_dissipateTC_1573346 = (_dissipateTC_1573346 + _dNoise_1563345));
float4 _tmpvar_1653354 = {0, 0, 0, 0};
(_tmpvar_1653354 = gl_texture2D(_sEffectMapSampler, _dissipateTC_1573346));
(_alpha_1553344 = _tmpvar_1653354.x);
}
float _tmpvar_1663355 = {0};
(_tmpvar_1663355 = clamp(_eDissipatedInvert, 0.0, 1.0));
(_alpha_1553344 = ((_alpha_1553344 * (1.0 - _tmpvar_1663355)) + ((1.0 - _alpha_1553344) * _tmpvar_1663355)));
(_alpha_1553344 = ((_alpha_1553344 * (1.0 - _eDissipatedHeightMix)) + (((_xlv_TEXCOORD8.y + _eDissipateHeightOffset) * _eDissipatedHeightScale) * _eDissipatedHeightMix)));
(_dissipatedControl_1543343 = ((((_ControlValue_1533342 * 2.0) * ((_eDissipatedEmissionEdge + _eDissipatedEmissionSoftness) + 0.5)) - _eDissipatedEmissionEdge) - _eDissipatedEmissionSoftness));
float _tmpvar_1673356 = {0};
float _edge0_1683357 = {0};
(_edge0_1683357 = (_dissipatedControl_1543343 - _eDissipatedEmissionSoftness));
float _tmpvar_1693358 = {0};
(_tmpvar_1693358 = clamp(((_alpha_1553344 - _edge0_1683357) / ((_dissipatedControl_1543343 + _eDissipatedEmissionSoftness) - _edge0_1683357)), 0.0, 1.0));
(_tmpvar_1673356 = (_tmpvar_1693358 * (_tmpvar_1693358 * (3.0 - (2.0 * _tmpvar_1693358)))));
(_tmpvar_1583347 = (1.0 - _tmpvar_1673356));
float _tmpvar_1703359 = {0};
float _edge0_1713360 = {0};
(_edge0_1713360 = ((_dissipatedControl_1543343 + _eDissipatedEmissionEdge) - _eDissipatedEmissionSoftness));
float _tmpvar_1723361 = {0};
(_tmpvar_1723361 = clamp(((_alpha_1553344 - _edge0_1713360) / (((_dissipatedControl_1543343 + _eDissipatedEmissionEdge) + _eDissipatedEmissionSoftness) - _edge0_1713360)), 0.0, 1.0));
(_tmpvar_1703359 = (_tmpvar_1723361 * (_tmpvar_1723361 * (3.0 - (2.0 * _tmpvar_1723361)))));
(_tmpvar_1593348 = (1.0 - _tmpvar_1703359));
float _ControlValue_1733362 = {0};
(_ControlValue_1733362 = (_eDissipatedBaseControl + _eControl));
float _dissipatedControl_1743363 = {0};
float _alpha_1753364 = {0};
float _dNoise_1763365 = {0};
float2 _dissipateTC_1773366 = {0, 0};
float _tmpvar_1783367 = {0};
float2 _tmpvar_1793368 = {0, 0};
(_tmpvar_1793368 = ((_xlv_TEXCOORD0.xy * _eDissipatedUVScrolling.xy) + (_CameraPosPS.w * _eDissipatedUVScrolling.zw)));
(_dissipateTC_1773366 = _tmpvar_1793368);
float2 _tmpvar_1803369 = {0, 0};
(_tmpvar_1803369 = ((_xlv_TEXCOORD0.xy * _eDissipatedNoiseUVScrolling.xy) + (_CameraPosPS.w * _eDissipatedNoiseUVScrolling.zw)));
(_dNoise_1763365 = 0.0);
(_alpha_1753364 = 0.0);
if ((_eDissipatedUseNormal == 1.0))
{
float4 _tmpvar_1813370 = {0, 0, 0, 0};
(_tmpvar_1813370 = gl_texture2D(_sNormalSampler, _tmpvar_1803369));
(_dNoise_1763365 = (_tmpvar_1813370.y * _eDissipatedNoiseStrength));
(_dissipateTC_1773366 = (_tmpvar_1793368 + _dNoise_1763365));
float4 _tmpvar_1823371 = {0, 0, 0, 0};
(_tmpvar_1823371 = gl_texture2D(_sNormalSampler, _dissipateTC_1773366));
(_alpha_1753364 = _tmpvar_1823371.x);
}
else
{
float4 _tmpvar_1833372 = {0, 0, 0, 0};
(_tmpvar_1833372 = gl_texture2D(_sEffectMapSampler, _tmpvar_1803369));
(_dNoise_1763365 = (_tmpvar_1833372.y * _eDissipatedNoiseStrength));
(_dissipateTC_1773366 = (_dissipateTC_1773366 + _dNoise_1763365));
float4 _tmpvar_1843373 = {0, 0, 0, 0};
(_tmpvar_1843373 = gl_texture2D(_sEffectMapSampler, _dissipateTC_1773366));
(_alpha_1753364 = _tmpvar_1843373.x);
}
float _tmpvar_1853374 = {0};
(_tmpvar_1853374 = clamp(_eDissipatedInvert, 0.0, 1.0));
(_alpha_1753364 = ((_alpha_1753364 * (1.0 - _tmpvar_1853374)) + ((1.0 - _alpha_1753364) * _tmpvar_1853374)));
(_alpha_1753364 = ((_alpha_1753364 * (1.0 - _eDissipatedHeightMix)) + (((_xlv_TEXCOORD8.y + _eDissipateHeightOffset) * _eDissipatedHeightScale) * _eDissipatedHeightMix)));
(_dissipatedControl_1743363 = ((((_ControlValue_1733362 * 2.0) * ((_eDissipatedBaseEdge + _eDissipatedBaseSoftness) + 0.5)) - _eDissipatedBaseEdge) - _eDissipatedBaseSoftness));
float _tmpvar_1863375 = {0};
float _edge0_1873376 = {0};
(_edge0_1873376 = (_dissipatedControl_1743363 - _eDissipatedBaseSoftness));
float _tmpvar_1883377 = {0};
(_tmpvar_1883377 = clamp(((_alpha_1753364 - _edge0_1873376) / ((_dissipatedControl_1743363 + _eDissipatedBaseSoftness) - _edge0_1873376)), 0.0, 1.0));
(_tmpvar_1863375 = (_tmpvar_1883377 * (_tmpvar_1883377 * (3.0 - (2.0 * _tmpvar_1883377)))));
(_tmpvar_1783367 = (1.0 - _tmpvar_1863375));
float _tmpvar_1893378 = {0};
(_tmpvar_1893378 = max(_eDissipatedBaseEdge, _eDissipatedEmissionEdge));
float _tmpvar_1903379 = {0};
(_tmpvar_1903379 = max(_eDissipatedBaseSoftness, _eDissipatedEmissionSoftness));
float _ControlValue_1913380 = {0};
(_ControlValue_1913380 = (max(_eDissipatedBaseControl, _eDissipatedEmissionControl) + _eControl));
float _dissipatedControl_1923381 = {0};
float _alpha_1933382 = {0};
float _dNoise_1943383 = {0};
float2 _dissipateTC_1953384 = {0, 0};
float _tmpvar_1963385 = {0};
float2 _tmpvar_1973386 = {0, 0};
(_tmpvar_1973386 = ((_xlv_TEXCOORD0.xy * _eDissipatedUVScrolling.xy) + (_CameraPosPS.w * _eDissipatedUVScrolling.zw)));
(_dissipateTC_1953384 = _tmpvar_1973386);
float2 _tmpvar_1983387 = {0, 0};
(_tmpvar_1983387 = ((_xlv_TEXCOORD0.xy * _eDissipatedNoiseUVScrolling.xy) + (_CameraPosPS.w * _eDissipatedNoiseUVScrolling.zw)));
(_dNoise_1943383 = 0.0);
(_alpha_1933382 = 0.0);
if ((_eDissipatedUseNormal == 1.0))
{
float4 _tmpvar_1993388 = {0, 0, 0, 0};
(_tmpvar_1993388 = gl_texture2D(_sNormalSampler, _tmpvar_1983387));
(_dNoise_1943383 = (_tmpvar_1993388.y * _eDissipatedNoiseStrength));
(_dissipateTC_1953384 = (_tmpvar_1973386 + _dNoise_1943383));
float4 _tmpvar_2003389 = {0, 0, 0, 0};
(_tmpvar_2003389 = gl_texture2D(_sNormalSampler, _dissipateTC_1953384));
(_alpha_1933382 = _tmpvar_2003389.x);
}
else
{
float4 _tmpvar_2013390 = {0, 0, 0, 0};
(_tmpvar_2013390 = gl_texture2D(_sEffectMapSampler, _tmpvar_1983387));
(_dNoise_1943383 = (_tmpvar_2013390.y * _eDissipatedNoiseStrength));
(_dissipateTC_1953384 = (_dissipateTC_1953384 + _dNoise_1943383));
float4 _tmpvar_2023391 = {0, 0, 0, 0};
(_tmpvar_2023391 = gl_texture2D(_sEffectMapSampler, _dissipateTC_1953384));
(_alpha_1933382 = _tmpvar_2023391.x);
}
float _tmpvar_2033392 = {0};
(_tmpvar_2033392 = clamp(_eDissipatedInvert, 0.0, 1.0));
(_alpha_1933382 = ((_alpha_1933382 * (1.0 - _tmpvar_2033392)) + ((1.0 - _alpha_1933382) * _tmpvar_2033392)));
(_alpha_1933382 = ((_alpha_1933382 * (1.0 - _eDissipatedHeightMix)) + (((_xlv_TEXCOORD8.y + _eDissipateHeightOffset) * _eDissipatedHeightScale) * _eDissipatedHeightMix)));
(_dissipatedControl_1923381 = ((((_ControlValue_1913380 * 2.0) * ((_tmpvar_1893378 + _tmpvar_1903379) + 0.5)) - _tmpvar_1893378) - _tmpvar_1903379));
float _tmpvar_2043393 = {0};
float _edge0_2053394 = {0};
(_edge0_2053394 = ((_dissipatedControl_1923381 + _tmpvar_1893378) - _tmpvar_1903379));
float _tmpvar_2063395 = {0};
(_tmpvar_2063395 = clamp(((_alpha_1933382 - _edge0_2053394) / (((_dissipatedControl_1923381 + _tmpvar_1893378) + _tmpvar_1903379) - _edge0_2053394)), 0.0, 1.0));
(_tmpvar_2043393 = (_tmpvar_2063395 * (_tmpvar_2063395 * (3.0 - (2.0 * _tmpvar_2063395)))));
(_tmpvar_1963385 = (1.0 - _tmpvar_2043393));
(_alphaRef_1523341 = (_alphaRef_1523341 * _tmpvar_1963385));
(_Emission_1473336 = (_Emission_1473336 + (((_tmpvar_1593348 - _tmpvar_1583347) * _eDissipatedEdgeEmissionColor) * _eDissipatedEdgeEmissionIntensity)));
float _tmpvar_2073396 = {0};
(_tmpvar_2073396 = min(_tmpvar_1583347, _tmpvar_1783367));
float _tmpvar_2083397 = {0};
(_tmpvar_2083397 = min(_tmpvar_1583347, _tmpvar_1783367));
(_BaseColor_1483337 = ((_BaseColor_1483337 * (1.0 - (_eDissipatedEdgeBaseColorAlpha * (1.0 - _tmpvar_2073396)))) + (_eDissipatedEdgeBaseColor * (_eDissipatedEdgeBaseColorAlpha * (1.0 - _tmpvar_2083397)))));
(_Alpha_1493338 = _alphaRef_1523341);
}
if ((_eFresnelEffect >= 0.80000001))
{
float3 _FresnelN_2093398 = {0, 0, 0};
float _fresnel_2103399 = {0};
(_fresnel_2103399 = 1.0);
float _tmpvar_2113400 = {0};
(_tmpvar_2113400 = abs(_eFresnelPower));
float3 _tmpvar_2123401 = {0, 0, 0};
(_tmpvar_2123401 = normalize(_xlv_TEXCOORD3.xyz));
(_FresnelN_2093398 = _tmpvar_913280);
if ((_eFresnelPower < 0.0))
{
(_fresnel_2103399 = pow(abs(dot(_FresnelN_2093398, _tmpvar_2123401)), _tmpvar_2113400));
}
else
{
(_fresnel_2103399 = pow((1.0 - min(0.99989998, abs(dot(_FresnelN_2093398, _tmpvar_2123401)))), _tmpvar_2113400));
}
(_fresnel_2103399 = (max(_eFresnelMinIntensity, _fresnel_2103399) * (1.0 - ((((1.0 - _eFresnelBreathMinLum) * 2.0) * abs((0.5 - frac((_CameraPosPS.w * _eFresnelBreathFreq))))) * float_ctor((_eFresnelBreathFreq >= 0.001))))));
float3 _x_2133402 = {0, 0, 0};
(_x_2133402 = (_xlv_TEXCOORD8.xyz - _eFresnelFadeCenter));
float2 _x_2143403 = {0, 0};
(_x_2143403 = (_xlv_TEXCOORD0.zw - _eFresnelFadeCenter.xy));
(_fresnel_2103399 = (_fresnel_2103399 * ((pow((1.0 - clamp(((sqrt(dot(_x_2133402, _x_2133402)) / _eFresnelFade) - _eFresnelFadeTargetRadius), 0.0, 1.0)), _eFresnelFadePower) * (1.0 - _eFresnelFadeUVFlag)) + (pow((1.0 - clamp(((sqrt(dot(_x_2143403, _x_2143403)) / _eFresnelFade) - _eFresnelFadeTargetRadius), 0.0, 1.0)), _eFresnelFadePower) * _eFresnelFadeUVFlag))));
(_Emission_1473336 = (_Emission_1473336 + ((_fresnel_2103399 * _eFresnelColor) * _eFresnelColorInt)));
float _tmpvar_2153404 = {0};
(_tmpvar_2153404 = (1.0 - _eFresnelOnlyEmission));
(_BaseColor_1483337 = ((_BaseColor_1483337 * (1.0 - (_fresnel_2103399 * _tmpvar_2153404))) + ((_eFresnelColor * _eFresnelColorInt) * (_fresnel_2103399 * _tmpvar_2153404))));
}
if ((_eIceEffect >= 0.80000001))
{
float3 _IceEmission_2163405 = {0, 0, 0};
float _IceEdgeMask_2173406 = {0};
float _IceMask_2183407 = {0};
float _Icefresnel_2193408 = {0};
float2 _tmpvar_2203409 = {0, 0};
(_tmpvar_2203409 = ((_xlv_TEXCOORD0.xy * _eIceUVScrolling.xy) + (_CameraPosPS.w * _eIceUVScrolling.zw)));
float4 _tmpvar_2213410 = {0, 0, 0, 0};
(_tmpvar_2213410 = gl_texture2D(_sEffectMapSampler, _tmpvar_2203409));
float _tmpvar_2223411 = {0};
(_tmpvar_2223411 = clamp(dot(((_xlv_TEXCOORD2.xyz * (1.0 - _eIceDetailScale)) + (_tmpvar_913280 * _eIceDetailScale)), normalize((-_xlv_TEXCOORD3.xyz))), 0.0, 1.0));
(_Icefresnel_2193408 = (1.0 - _tmpvar_2223411));
float _tmpvar_2233412 = {0};
float _tmpvar_2243413 = {0};
(_tmpvar_2243413 = clamp(((_Icefresnel_2193408 - -0.5) / 1.5), 0.0, 1.0));
(_tmpvar_2233412 = (_tmpvar_2243413 * (_tmpvar_2243413 * (3.0 - (2.0 * _tmpvar_2243413)))));
(_Icefresnel_2193408 = _tmpvar_2233412);
float _tmpvar_2253414 = {0};
float _tmpvar_2263415 = {0};
(_tmpvar_2263415 = clamp(((_tmpvar_2233412 - 0.69999999) / 0.2), 0.0, 1.0));
(_tmpvar_2253414 = (_tmpvar_2263415 * (_tmpvar_2263415 * (3.0 - (2.0 * _tmpvar_2263415)))));
float _tmpvar_2273416 = {0};
(_tmpvar_2273416 = ((_eIceHeightHigh - _eIceHeightLow) * _eIceStartRatio));
float _tmpvar_2283417 = {0};
(_tmpvar_2283417 = clamp((((((0.30000001 * (1.0 - _tmpvar_2213410.x)) + (0.69999999 * _tmpvar_2213410.x)) * (1.0 - _eIceHeightBlend)) + (clamp((1.0 - (abs((_xlv_TEXCOORD8.y - _tmpvar_2273416)) / max(abs((_tmpvar_2273416 - _eIceHeightHigh)), abs((_tmpvar_2273416 - _eIceHeightLow))))), 0.0, 1.0) * _eIceHeightBlend)) - (1.0 - _eIceControl)), 0.0, 1.0));
(_IceMask_2183407 = _tmpvar_2283417);
float _tmpvar_2293418 = {0};
float _tmpvar_2303419 = {0};
(_tmpvar_2303419 = clamp(((_IceMask_2183407 - 0.050000001) / 0.050000001), 0.0, 1.0));
(_tmpvar_2293418 = (_tmpvar_2303419 * (_tmpvar_2303419 * (3.0 - (2.0 * _tmpvar_2303419)))));
float _tmpvar_2313420 = {0};
(_tmpvar_2313420 = clamp(((_IceMask_2183407 - 0.079999998) / ((0.079999998 + _eIceEdgeSoft) - 0.079999998)), 0.0, 1.0));
float _tmpvar_2323421 = {0};
(_tmpvar_2323421 = (1.0 - (_tmpvar_2313420 * (_tmpvar_2313420 * (3.0 - (2.0 * _tmpvar_2313420))))));
(_IceEdgeMask_2173406 = _tmpvar_2323421);
float _tmpvar_2333422 = {0};
(_tmpvar_2333422 = max(_tmpvar_2253414, _IceEdgeMask_2173406));
float3 _tmpvar_2343423 = {0, 0, 0};
(_tmpvar_2343423 = ((((_tmpvar_2233412 * _eIceColorBase) * ((0.5 * (1.0 - _tmpvar_2213410.x)) + _tmpvar_2213410.x)) * _eIceColorBaseIns) + ((_tmpvar_2333422 * _eIceColorEdge) * _eIceColorEdgeIns)));
(_IceEmission_2163405 = _tmpvar_2343423);
(_Emission_1473336 = (_Emission_1473336 + (_tmpvar_2293418 * _IceEmission_2163405)));
(_Extra_1513340.xyz = (_tmpvar_2293418 * _IceEmission_2163405));
(_BaseColor_1483337 = ((_BaseColor_1483337 * (1.0 - (_tmpvar_2293418 * 0.75))) + (clamp((((_tmpvar_2233412 * ((0.5 * (1.0 - _tmpvar_2213410.x)) + _tmpvar_2213410.x)) * _eIceColorBase) + (_tmpvar_2253414 * _eIceColorEdge)), 0.0, 1.0) * (_tmpvar_2293418 * 0.75))));
float _y_2353424 = {0};
(_y_2353424 = ((0.5 * (1.0 - _tmpvar_2213410.x)) + (0.2 * _tmpvar_2213410.x)));
(_Roughness_1503339 = ((_Roughness_1503339 * (1.0 - _tmpvar_2293418)) + (min(_Roughness_1503339, _y_2353424) * _tmpvar_2293418)));
}
(_Emission_113200.xyz = _Emission_1473336);
(_BaseColor_133202 = _BaseColor_1483337);
(_Alpha_93198 = _Alpha_1493338);
(_Roughness_123201 = _Roughness_1503339);
(_OUT_143203.w = _Alpha_93198);
float3 _tmpvar_2363425 = {0, 0, 0};
(_tmpvar_2363425 = (_xlv_TEXCOORD7.xyz / _xlv_TEXCOORD7.w));
float _tmpvar_2373426 = {0};
(_tmpvar_2373426 = min(0.99998999, _tmpvar_2363425.z));
float2 _tmpvar_2383427 = {0, 0};
(_tmpvar_2383427 = vec2_ctor((abs((_tmpvar_2363425.xy - 0.5)) < float2(0.5, 0.5))));
(_inRange_63195 = _tmpvar_2383427);
(_inRange_63195.x = (_inRange_63195.x * _inRange_63195.y));
float _inShadow_2393428 = {0};
float3 _sampleDepth3_2403429 = {0, 0, 0};
float3 _sampleDepth2_2413430 = {0, 0, 0};
float3 _sampleDepth1_2423431 = {0, 0, 0};
(_sampleDepth1_2423431.x = dot(gl_texture2D(_sShadowMapSampler, (_tmpvar_2363425.xy - _cShadowBias.ww)), float4(1.0, 0.0039215689, 1.53787e-05, 6.0308629e-08)));
(_sampleDepth1_2423431.y = dot(gl_texture2D(_sShadowMapSampler, (_tmpvar_2363425.xy + (_cShadowBias.ww * float2(0.0, -1.0)))), float4(1.0, 0.0039215689, 1.53787e-05, 6.0308629e-08)));
(_sampleDepth1_2423431.z = dot(gl_texture2D(_sShadowMapSampler, (_tmpvar_2363425.xy + (_cShadowBias.ww * float2(1.0, -1.0)))), float4(1.0, 0.0039215689, 1.53787e-05, 6.0308629e-08)));
(_sampleDepth2_2413430.x = dot(gl_texture2D(_sShadowMapSampler, (_tmpvar_2363425.xy + (_cShadowBias.ww * float2(-1.0, 0.0)))), float4(1.0, 0.0039215689, 1.53787e-05, 6.0308629e-08)));
(_sampleDepth2_2413430.y = dot(gl_texture2D(_sShadowMapSampler, _tmpvar_2363425.xy), float4(1.0, 0.0039215689, 1.53787e-05, 6.0308629e-08)));
(_sampleDepth2_2413430.z = dot(gl_texture2D(_sShadowMapSampler, (_tmpvar_2363425.xy + (_cShadowBias.ww * float2(1.0, 0.0)))), float4(1.0, 0.0039215689, 1.53787e-05, 6.0308629e-08)));
(_sampleDepth3_2403429.x = dot(gl_texture2D(_sShadowMapSampler, (_tmpvar_2363425.xy + (_cShadowBias.ww * float2(-1.0, 1.0)))), float4(1.0, 0.0039215689, 1.53787e-05, 6.0308629e-08)));
(_sampleDepth3_2403429.y = dot(gl_texture2D(_sShadowMapSampler, (_tmpvar_2363425.xy + (_cShadowBias.ww * float2(0.0, 1.0)))), float4(1.0, 0.0039215689, 1.53787e-05, 6.0308629e-08)));
(_sampleDepth3_2403429.z = dot(gl_texture2D(_sShadowMapSampler, (_tmpvar_2363425.xy + _cShadowBias.ww)), float4(1.0, 0.0039215689, 1.53787e-05, 6.0308629e-08)));
float3 _tmpvar_2433432 = {0, 0, 0};
(_tmpvar_2433432 = vec3_ctor((vec3_ctor(_tmpvar_2373426) > _sampleDepth2_2413430)));
float2 _tmpvar_2443433 = {0, 0};
(_tmpvar_2443433 = frac((_tmpvar_2363425.xy / _cShadowBias.ww)));
float4 _tmpvar_2453434 = {0, 0, 0, 0};
(_tmpvar_2453434 = ((vec3_ctor((vec3_ctor(_tmpvar_2373426) > _sampleDepth1_2423431)).xyyz * (1.0 - _tmpvar_2443433.y)) + (_tmpvar_2433432.xyyz * _tmpvar_2443433.y)));
float4 _tmpvar_2463435 = {0, 0, 0, 0};
(_tmpvar_2463435 = ((_tmpvar_2433432.xyyz * (1.0 - _tmpvar_2443433.y)) + (vec3_ctor((vec3_ctor(_tmpvar_2373426) > _sampleDepth3_2403429)).xyyz * _tmpvar_2443433.y)));
(_inShadow_2393428 = ((_tmpvar_2453434.x * (1.0 - _tmpvar_2443433.x)) + (_tmpvar_2453434.y * _tmpvar_2443433.x)));
(_inShadow_2393428 = (_inShadow_2393428 + ((_tmpvar_2453434.z * (1.0 - _tmpvar_2443433.x)) + (_tmpvar_2453434.w * _tmpvar_2443433.x))));
(_inShadow_2393428 = (_inShadow_2393428 + ((_tmpvar_2463435.x * (1.0 - _tmpvar_2443433.x)) + (_tmpvar_2463435.y * _tmpvar_2443433.x))));
(_inShadow_2393428 = (_inShadow_2393428 + ((_tmpvar_2463435.z * (1.0 - _tmpvar_2443433.x)) + (_tmpvar_2463435.w * _tmpvar_2443433.x))));
(_inShadow_2393428 = (_inShadow_2393428 * 0.25));
(_shadow2_73196 = _inShadow_2393428);
(_shadow2_73196 = (_shadow2_73196 * _inRange_63195.x));
(_shadow2_73196 = (1.0 - _shadow2_73196));
(_shadow_83197 = min(1.0, _shadow2_73196));
(_SpecularColor_43193 = ((float3(0.039999999, 0.039999999, 0.039999999) * (1.0 - _color_383227.yyy)) + (_BaseColor_133202 * _color_383227.yyy)));
(_DiffuseColor_53194 = ((_BaseColor_133202 - (_BaseColor_133202 * _color_383227.y)) / 3.141593));
float3 _tmpvar_2473436 = {0, 0, 0};
(_tmpvar_2473436 = normalize((-_xlv_TEXCOORD3.xyz)));
float3 _I_2483437 = {0, 0, 0};
(_I_2483437 = (-_tmpvar_2473436));
(_R_33192 = (_I_2483437 - (2.0 * (dot(_tmpvar_913280, _I_2483437) * _tmpvar_913280))));
float _color_2493438 = {0};
(_color_2493438 = clamp(dot(_tmpvar_913280, _tmpvar_2473436), 0.0, 1.0));
float _color_2503439 = {0};
(_color_2503439 = dot(_SunDirection.xyz, _tmpvar_913280));
(_shadow_83197 = (_shadow_83197 * clamp(((abs(_color_2503439) + ((2.0 * _color_383227.z) * _color_383227.z)) - 1.0), 0.0, 1.0)));
(_diffLighting_23191 = _xlv_TEXCOORD4.xyz);
float _tmpvar_2513440 = {0};
(_tmpvar_2513440 = _ShadowColor.y);
(_SunlightOffset_13190 = _tmpvar_2513440);
(_shadow_83197 = (_shadow_83197 * _SunlightOffset_13190));
(_shadow_83197 = (_shadow_83197 * _cPointCloud[0].w));
(_GILighting_103199.xyz = _GILighting_193208.xyz);
(_diffLighting_23191 = (_diffLighting_23191 + ((_linearColor_1243313.xyz * _color_383227.z) * (1.0 - _UserData[2].y))));
(_GILighting_103199.w = (_color_383227.z * clamp(dot(_diffLighting_23191, float3(0.30000001, 0.58999997, 0.11)), 0.0, 1.0)));
float3 _tmpvar_2523441 = {0, 0, 0};
(_tmpvar_2523441 = ((clamp(_color_2503439, 0.0, 1.0) * _shadow_83197) * _SunColor.xyz));
(_diffLighting_23191 = (_diffLighting_23191 + _tmpvar_2523441));
float _G_2533442 = {0};
float _D_2543443 = {0};
float _m_2553444 = {0};
float3 _sunSpec_2563445 = {0, 0, 0};
float3 _Spec_2573446 = {0, 0, 0};
float _NoL_2583447 = {0};
float _tmpvar_2593448 = {0};
(_tmpvar_2593448 = clamp(dot(_tmpvar_913280, _SunDirection.xyz), 0.0, 1.0));
(_NoL_2583447 = _tmpvar_2593448);
(_Spec_2573446 = float3(0.0, 0.0, 0.0));
float3 _tmpvar_2603449 = {0, 0, 0};
float4 _tmpvar_2613450 = {0, 0, 0, 0};
(_tmpvar_2613450 = ((_Roughness_123201 * float4(-1.0, -0.0275, -0.57200003, 0.022)) + float4(1.0, 0.0425, 1.04, -0.039999999)));
float2 _tmpvar_2623451 = {0, 0};
(_tmpvar_2623451 = ((float2(-1.04, 1.04) * ((min((_tmpvar_2613450.x * _tmpvar_2613450.x), exp2((-9.2799997 * _color_2493438))) * _tmpvar_2613450.x) + _tmpvar_2613450.y)) + _tmpvar_2613450.zw));
(_tmpvar_2603449 = ((_SpecularColor_43193 * _tmpvar_2623451.x) + _tmpvar_2623451.y));
float3 _R_2633452 = {0, 0, 0};
(_R_2633452.z = _R_33192.z);
float _fSign_2643453 = {0};
float4 _sampleEnvSpecular_2653454 = {0, 0, 0, 0};
(_sampleEnvSpecular_2653454 = float4(0.0, 0.0, 0.0, 0.0));
float _tmpvar_2663455 = {0};
(_tmpvar_2663455 = (_Roughness_123201 / 0.17));
float _tmpvar_2673456 = {0};
(_tmpvar_2673456 = float_ctor((_R_33192.z > 0.0)));
(_fSign_2643453 = _tmpvar_2673456);
float _tmpvar_2683457 = {0};
(_tmpvar_2683457 = ((_fSign_2643453 * 2.0) - 1.0));
(_R_2633452.xy = (_R_33192.xy / ((_R_33192.z * _tmpvar_2683457) + 1.0)));
(_R_2633452.xy = ((_R_2633452.xy * float2(0.25, -0.25)) + (0.25 + (0.5 * _fSign_2643453))));
float4 _srcColor_2693458 = {0, 0, 0, 0};
(_srcColor_2693458 = float4(0.0, 0.0, 0.0, 0.0));
float _tmpvar_2703459 = {0};
(_tmpvar_2703459 = frac(_cVirtualLitColor.w));
if ((_tmpvar_2703459 > 0.0))
{
float3 _tmpvar_2713460 = {0, 0, 0};
(_tmpvar_2713460 = frac((_cVirtualLitDir.w / float3(16777220.0, 65536.0, 256.0))));
int _tmpvar_2723461 = {0};
(_tmpvar_2723461 = int_ctor(floor(_cVirtualLitColor.w)));
float3 _tmpvar_2733462 = {0, 0, 0};
(_tmpvar_2733462.x = float_ctor_int((_tmpvar_2723461 / 10000)));
(_tmpvar_2733462.y = (float_ctor(mod_emu(float_ctor_int(_tmpvar_2723461), 10000.0)) / 100.0));
(_tmpvar_2733462.z = float_ctor(mod_emu(float_ctor_int(_tmpvar_2723461), 100.0)));
if ((_tmpvar_2713460.x > 0.0))
{
float4 _srcColor_2743463 = {0, 0, 0, 0};
float _edgeClampValue_2753464 = {0};
float2 _envMapUV_2763465 = {0, 0};
float _tmpvar_2773466 = {0};
(_tmpvar_2773466 = (0.015 * _tmpvar_2663455));
(_edgeClampValue_2753464 = _tmpvar_2773466);
(_envMapUV_2763465.x = (_tmpvar_2703459 * (float_ctor_int(int_ctor(float_ctor(mod_emu(_tmpvar_2733462.x, 10.0)))) + clamp(_R_2633452.x, _edgeClampValue_2753464, (1.0 - _edgeClampValue_2753464)))));
(_envMapUV_2763465.y = (_tmpvar_2703459 * (float_ctor_int(int_ctor(floor((_tmpvar_2733462.x / 10.0)))) + clamp(_R_2633452.y, _edgeClampValue_2753464, (1.0 - _edgeClampValue_2753464)))));
float4 _tmpvar_2783467 = {0, 0, 0, 0};
(_tmpvar_2783467 = gl_texture2DLod(_sEnvSampler, _envMapUV_2763465, _tmpvar_2663455));
(_srcColor_2743463.w = _tmpvar_2783467.w);
(_srcColor_2743463.xyz = (_tmpvar_2783467.xyz * ((_tmpvar_2783467.w * _tmpvar_2783467.w) * 16.0)));
(_srcColor_2693458 = (_srcColor_2743463 * _tmpvar_2713460.x));
}
if ((_tmpvar_2713460.y > 0.0))
{
float4 _srcColor_2793468 = {0, 0, 0, 0};
float _edgeClampValue_2803469 = {0};
float2 _envMapUV_2813470 = {0, 0};
float _tmpvar_2823471 = {0};
(_tmpvar_2823471 = (0.015 * _tmpvar_2663455));
(_edgeClampValue_2803469 = _tmpvar_2823471);
(_envMapUV_2813470.x = (_tmpvar_2703459 * (float_ctor_int(int_ctor(float_ctor(mod_emu(_tmpvar_2733462.y, 10.0)))) + clamp(_R_2633452.x, _edgeClampValue_2803469, (1.0 - _edgeClampValue_2803469)))));
(_envMapUV_2813470.y = (_tmpvar_2703459 * (float_ctor_int(int_ctor(floor((_tmpvar_2733462.y / 10.0)))) + clamp(_R_2633452.y, _edgeClampValue_2803469, (1.0 - _edgeClampValue_2803469)))));
float4 _tmpvar_2833472 = {0, 0, 0, 0};
(_tmpvar_2833472 = gl_texture2DLod(_sEnvSampler, _envMapUV_2813470, _tmpvar_2663455));
(_srcColor_2793468.w = _tmpvar_2833472.w);
(_srcColor_2793468.xyz = (_tmpvar_2833472.xyz * ((_tmpvar_2833472.w * _tmpvar_2833472.w) * 16.0)));
(_srcColor_2693458 = (_srcColor_2693458 + (_srcColor_2793468 * _tmpvar_2713460.y)));
}
if ((_tmpvar_2713460.z > 0.0))
{
float4 _srcColor_2843473 = {0, 0, 0, 0};
float _edgeClampValue_2853474 = {0};
float2 _envMapUV_2863475 = {0, 0};
float _tmpvar_2873476 = {0};
(_tmpvar_2873476 = (0.015 * _tmpvar_2663455));
(_edgeClampValue_2853474 = _tmpvar_2873476);
(_envMapUV_2863475.x = (_tmpvar_2703459 * (float_ctor_int(int_ctor(float_ctor(mod_emu(_tmpvar_2733462.z, 10.0)))) + clamp(_R_2633452.x, _edgeClampValue_2853474, (1.0 - _edgeClampValue_2853474)))));
(_envMapUV_2863475.y = (_tmpvar_2703459 * (float_ctor_int(int_ctor(floor((_tmpvar_2733462.z / 10.0)))) + clamp(_R_2633452.y, _edgeClampValue_2853474, (1.0 - _edgeClampValue_2853474)))));
float4 _tmpvar_2883477 = {0, 0, 0, 0};
(_tmpvar_2883477 = gl_texture2DLod(_sEnvSampler, _envMapUV_2863475, _tmpvar_2663455));
(_srcColor_2843473.w = _tmpvar_2883477.w);
(_srcColor_2843473.xyz = (_tmpvar_2883477.xyz * ((_tmpvar_2883477.w * _tmpvar_2883477.w) * 16.0)));
(_srcColor_2693458 = (_srcColor_2693458 + (_srcColor_2843473 * _tmpvar_2713460.z)));
}
}
else
{
float4 _tmpvar_2893478 = {0, 0, 0, 0};
(_tmpvar_2893478 = gl_texture2DLod(_sEnvSampler, _R_2633452.xy, _tmpvar_2663455));
(_srcColor_2693458.w = _tmpvar_2893478.w);
(_srcColor_2693458.xyz = (_tmpvar_2893478.xyz * ((_tmpvar_2893478.w * _tmpvar_2893478.w) * 16.0)));
}
(_sampleEnvSpecular_2653454.xyz = (_srcColor_2693458.xyz * ((_cEnvStrength * _GILighting_103199.w) * (_EnvInfo.w * 10.0))));
float3 _tmpvar_2903479 = {0, 0, 0};
(_tmpvar_2903479 = normalize((_tmpvar_2473436 + _SunDirection.xyz)));
float _tmpvar_2913480 = {0};
(_tmpvar_2913480 = clamp(dot(_tmpvar_913280, _tmpvar_2903479), 0.0, 1.0));
float _tmpvar_2923481 = {0};
(_tmpvar_2923481 = clamp(dot(_tmpvar_2473436, _tmpvar_2903479), 0.0, 1.0));
float _tmpvar_2933482 = {0};
(_tmpvar_2933482 = max(0.079999998, _Roughness_123201));
float _tmpvar_2943483 = {0};
(_tmpvar_2943483 = (_tmpvar_2933482 * _tmpvar_2933482));
(_m_2553444 = _tmpvar_2943483);
float _tmpvar_2953484 = {0};
(_tmpvar_2953484 = (_m_2553444 * _m_2553444));
float _tmpvar_2963485 = {0};
(_tmpvar_2963485 = ((((_tmpvar_2913480 * _tmpvar_2953484) - _tmpvar_2913480) * _tmpvar_2913480) + 1.0));
(_D_2543443 = (_tmpvar_2953484 / ((_tmpvar_2963485 * _tmpvar_2963485) * 3.141593)));
float _tmpvar_2973486 = {0};
(_tmpvar_2973486 = (_m_2553444 * 0.5));
float _tmpvar_2983487 = {0};
(_tmpvar_2983487 = clamp(_NoL_2583447, 0.0, 1.0));
float _tmpvar_2993488 = {0};
(_tmpvar_2993488 = (0.25 / (((_color_2493438 * (1.0 - _tmpvar_2973486)) + _tmpvar_2973486) * ((_tmpvar_2983487 * (1.0 - _tmpvar_2973486)) + _tmpvar_2973486))));
(_G_2533442 = _tmpvar_2993488);
float _color_3003489 = {0};
(_color_3003489 = exp2((((-5.5547299 * _tmpvar_2923481) - 6.98316) * _tmpvar_2923481)));
(_sunSpec_2563445 = ((_D_2543443 * _G_2533442) * (_tmpvar_2603449 + ((clamp((50.0 * _tmpvar_2603449.y), 0.0, 1.0) - _tmpvar_2603449) * _color_3003489))));
(_sunSpec_2563445 = (_sunSpec_2563445 * (_SunColor.xyz * clamp((_NoL_2583447 * _shadow_83197), 0.0, 1.0))));
(_Spec_2573446 = ((_tmpvar_2603449 * _sampleEnvSpecular_2653454.xyz) + _sunSpec_2563445));
(_SpecularColor_43193 = _tmpvar_2603449);
(_OUT_143203.xyz = _Spec_2573446);
float4 _OUT_3013490 = {0, 0, 0, 0};
(_OUT_3013490.w = _OUT_143203.w);
float3 _diffLighting_3023491 = {0, 0, 0};
float _D_3033492 = {0};
float _m2_3043493 = {0};
float3 _tmpvar_3053494 = {0, 0, 0};
(_tmpvar_3053494 = normalize(_cVirtualLitDir.xyz));
float _color_3063495 = {0};
(_color_3063495 = clamp(dot(_tmpvar_3053494, _tmpvar_913280), 0.0, 1.0));
float3 _color_3073496 = {0, 0, 0};
(_color_3073496 = (_cVirtualLitColor.xyz * (_Emission_183207.w * (0.44400001 + (_color_3063495 * 0.55599999)))));
(_diffLighting_3023491 = (_diffLighting_23191 + _color_3073496));
float _tmpvar_3083497 = {0};
(_tmpvar_3083497 = clamp(dot(_tmpvar_913280, normalize((_tmpvar_2473436 + _tmpvar_3053494))), 0.0, 1.0));
float _tmpvar_3093498 = {0};
(_tmpvar_3093498 = ((_Roughness_123201 * _Roughness_123201) + 0.00019999999));
(_m2_3043493 = _tmpvar_3093498);
(_m2_3043493 = (_m2_3043493 * _m2_3043493));
float _tmpvar_3103499 = {0};
(_tmpvar_3103499 = ((((_tmpvar_3083497 * _m2_3043493) - _tmpvar_3083497) * _tmpvar_3083497) + 1.0));
(_D_3033492 = ((_tmpvar_3103499 * _tmpvar_3103499) + 1e-06));
(_D_3033492 = ((0.25 * _m2_3043493) / _D_3033492));
(_OUT_3013490.xyz = (_OUT_143203.xyz + ((_color_3073496 * _tmpvar_2603449) * _D_3033492)));
(_OUT_143203.w = _OUT_3013490.w);
(_diffLighting_23191 = _diffLighting_3023491);
(_OUT_143203.xyz = ((_OUT_3013490.xyz + (_shadow_83197 * _Emission_113200.xyz)) + _Extra_1513340.xyz));
float3 _DiffLit_3113500 = {0, 0, 0};
(_DiffLit_3113500 = _diffLighting_3023491);
float3 _lighting_3123501 = {0, 0, 0};
(_lighting_3123501 = float3(0.0, 0.0, 0.0));
if ((_Lights0[3].w > 0.0))
{
float _D_3133502 = {0};
float _m2_3143503 = {0};
float _Atten_3153504 = {0};
float3 _L_3163505 = {0, 0, 0};
float3 _tmpvar_3173506 = {0, 0, 0};
(_tmpvar_3173506 = (_Lights0[0].xyz - _xlv_TEXCOORD1.xyz));
float _tmpvar_3183507 = {0};
(_tmpvar_3183507 = sqrt(dot(_tmpvar_3173506, _tmpvar_3173506)));
(_L_3163505 = (_tmpvar_3173506 / _tmpvar_3183507));
float _tmpvar_3193508 = {0};
(_tmpvar_3193508 = clamp(dot(_tmpvar_913280, _L_3163505), 0.0, 1.0));
float _tmpvar_3203509 = {0};
(_tmpvar_3203509 = clamp(((_tmpvar_3183507 * _Lights0[1].w) + _Lights0[0].w), 0.0, 1.0));
(_Atten_3153504 = (_tmpvar_3203509 * _tmpvar_3203509));
(_DiffLit_3113500 = (_diffLighting_3023491 + (_Lights0[1].xyz * (_tmpvar_3193508 * _Atten_3153504))));
float _tmpvar_3213510 = {0};
(_tmpvar_3213510 = ((_Roughness_123201 * _Roughness_123201) + 0.00019999999));
(_m2_3143503 = _tmpvar_3213510);
(_m2_3143503 = (_m2_3143503 * _m2_3143503));
float _tmpvar_3223511 = {0};
(_tmpvar_3223511 = clamp(dot(_tmpvar_913280, normalize((_tmpvar_2473436 + _L_3163505))), 0.0, 1.0));
float _tmpvar_3233512 = {0};
(_tmpvar_3233512 = ((((_tmpvar_3223511 * _m2_3143503) - _tmpvar_3223511) * _tmpvar_3223511) + 1.0));
(_D_3133502 = ((_tmpvar_3233512 * _tmpvar_3233512) + 1e-06));
(_D_3133502 = ((0.25 * _m2_3143503) / _D_3133502));
(_lighting_3123501 = ((_Lights0[1].xyz * _tmpvar_2603449) * ((_Atten_3153504 * _tmpvar_3193508) * _D_3133502)));
}
if (((_Lights1[3].w > 0.0) && (_Lights1[2].w > 0.0)))
{
float _D_3243513 = {0};
float _m2_3253514 = {0};
float _Atten_3263515 = {0};
float3 _L_3273516 = {0, 0, 0};
float3 _tmpvar_3283517 = {0, 0, 0};
(_tmpvar_3283517 = (_Lights1[0].xyz - _xlv_TEXCOORD1.xyz));
float _tmpvar_3293518 = {0};
(_tmpvar_3293518 = sqrt(dot(_tmpvar_3283517, _tmpvar_3283517)));
(_L_3273516 = (_tmpvar_3283517 / _tmpvar_3293518));
float _tmpvar_3303519 = {0};
(_tmpvar_3303519 = clamp(dot(_tmpvar_913280, _L_3273516), 0.0, 1.0));
float _tmpvar_3313520 = {0};
(_tmpvar_3313520 = clamp(((_tmpvar_3293518 * _Lights1[1].w) + _Lights1[0].w), 0.0, 1.0));
(_Atten_3263515 = (_tmpvar_3313520 * _tmpvar_3313520));
(_DiffLit_3113500 = (_DiffLit_3113500 + (_Lights1[1].xyz * (_tmpvar_3303519 * _Atten_3263515))));
float _tmpvar_3323521 = {0};
(_tmpvar_3323521 = ((_Roughness_123201 * _Roughness_123201) + 0.00019999999));
(_m2_3253514 = _tmpvar_3323521);
(_m2_3253514 = (_m2_3253514 * _m2_3253514));
float _tmpvar_3333522 = {0};
(_tmpvar_3333522 = clamp(dot(_tmpvar_913280, normalize((_tmpvar_2473436 + _L_3273516))), 0.0, 1.0));
float _tmpvar_3343523 = {0};
(_tmpvar_3343523 = ((((_tmpvar_3333522 * _m2_3253514) - _tmpvar_3333522) * _tmpvar_3333522) + 1.0));
(_D_3243513 = ((_tmpvar_3343523 * _tmpvar_3343523) + 1e-06));
(_D_3243513 = ((0.25 * _m2_3253514) / _D_3243513));
(_lighting_3123501 = ((_Lights1[1].xyz * _tmpvar_2603449) * ((_Atten_3263515 * _tmpvar_3303519) * _D_3243513)));
}
if (((_Lights2[3].w > 0.0) && (_Lights2[2].w > 0.0)))
{
float _D_3353524 = {0};
float _m2_3363525 = {0};
float _Atten_3373526 = {0};
float3 _L_3383527 = {0, 0, 0};
float3 _tmpvar_3393528 = {0, 0, 0};
(_tmpvar_3393528 = (_Lights2[0].xyz - _xlv_TEXCOORD1.xyz));
float _tmpvar_3403529 = {0};
(_tmpvar_3403529 = sqrt(dot(_tmpvar_3393528, _tmpvar_3393528)));
(_L_3383527 = (_tmpvar_3393528 / _tmpvar_3403529));
float _tmpvar_3413530 = {0};
(_tmpvar_3413530 = clamp(dot(_tmpvar_913280, _L_3383527), 0.0, 1.0));
float _tmpvar_3423531 = {0};
(_tmpvar_3423531 = clamp(((_tmpvar_3403529 * _Lights2[1].w) + _Lights2[0].w), 0.0, 1.0));
(_Atten_3373526 = (_tmpvar_3423531 * _tmpvar_3423531));
(_DiffLit_3113500 = (_DiffLit_3113500 + (_Lights2[1].xyz * (_tmpvar_3413530 * _Atten_3373526))));
float _tmpvar_3433532 = {0};
(_tmpvar_3433532 = ((_Roughness_123201 * _Roughness_123201) + 0.00019999999));
(_m2_3363525 = _tmpvar_3433532);
(_m2_3363525 = (_m2_3363525 * _m2_3363525));
float _tmpvar_3443533 = {0};
(_tmpvar_3443533 = clamp(dot(_tmpvar_913280, normalize((_tmpvar_2473436 + _L_3383527))), 0.0, 1.0));
float _tmpvar_3453534 = {0};
(_tmpvar_3453534 = ((((_tmpvar_3443533 * _m2_3363525) - _tmpvar_3443533) * _tmpvar_3443533) + 1.0));
(_D_3353524 = ((_tmpvar_3453534 * _tmpvar_3453534) + 1e-06));
(_D_3353524 = ((0.25 * _m2_3363525) / _D_3353524));
(_lighting_3123501 = ((_Lights2[1].xyz * _tmpvar_2603449) * ((_Atten_3373526 * _tmpvar_3413530) * _D_3353524)));
}
if (((_Lights1[3].w > 0.0) && (_Lights1[2].w <= 0.0)))
{
float _D_3463535 = {0};
float _m2_3473536 = {0};
float _spot_3483537 = {0};
float _Atten_3493538 = {0};
float _DoL_3503539 = {0};
float _NoL_3513540 = {0};
float3 _L_3523541 = {0, 0, 0};
float4 _tmpvar_3533542 = {0, 0, 0, 0};
(_tmpvar_3533542 = _Lights1[0]);
float4 _tmpvar_3543543 = {0, 0, 0, 0};
(_tmpvar_3543543 = _Lights1[1]);
float3 _tmpvar_3553544 = {0, 0, 0};
(_tmpvar_3553544 = _Lights1[3].xyz);
float3 _tmpvar_3563545 = {0, 0, 0};
(_tmpvar_3563545 = (_tmpvar_3533542.xyz - _xlv_TEXCOORD1.xyz));
(_L_3523541 = _tmpvar_3563545);
float _tmpvar_3573546 = {0};
(_tmpvar_3573546 = sqrt(dot(_L_3523541, _L_3523541)));
(_L_3523541 = (_L_3523541 / _tmpvar_3573546));
float _tmpvar_3583547 = {0};
(_tmpvar_3583547 = clamp(dot(_tmpvar_913280, _L_3523541), 0.0, 1.0));
(_NoL_3513540 = _tmpvar_3583547);
float _tmpvar_3593548 = {0};
float3 _y_3603549 = {0, 0, 0};
(_y_3603549 = (-_L_3523541));
(_tmpvar_3593548 = dot(_Lights1[2].xyz, _y_3603549));
(_DoL_3503539 = _tmpvar_3593548);
float _tmpvar_3613550 = {0};
(_tmpvar_3613550 = clamp(((_tmpvar_3573546 * _tmpvar_3543543.w) + _tmpvar_3533542.w), 0.0, 1.0));
(_Atten_3493538 = _tmpvar_3613550);
(_Atten_3493538 = (_Atten_3493538 * _Atten_3493538));
float _tmpvar_3623551 = {0};
(_tmpvar_3623551 = pow(clamp(((_DoL_3503539 * _tmpvar_3553544.y) + _tmpvar_3553544.z), 0.0, 1.0), _tmpvar_3553544.x));
(_spot_3483537 = _tmpvar_3623551);
float _tmpvar_3633552 = {0};
(_tmpvar_3633552 = ((_Roughness_123201 * _Roughness_123201) + 0.00019999999));
(_m2_3473536 = _tmpvar_3633552);
(_m2_3473536 = (_m2_3473536 * _m2_3473536));
float _tmpvar_3643553 = {0};
(_tmpvar_3643553 = clamp(dot(_tmpvar_913280, normalize((_tmpvar_2473436 + _L_3523541))), 0.0, 1.0));
float _tmpvar_3653554 = {0};
(_tmpvar_3653554 = ((((_tmpvar_3643553 * _m2_3473536) - _tmpvar_3643553) * _tmpvar_3643553) + 1.0));
(_D_3463535 = ((_tmpvar_3653554 * _tmpvar_3653554) + 1e-06));
(_D_3463535 = ((0.25 * _m2_3473536) / _D_3463535));
(_lighting_3123501 = (_lighting_3123501 + (((_Lights1[1].xyz * _tmpvar_2603449) * ((_Atten_3493538 * _NoL_3513540) * _D_3463535)) * _spot_3483537)));
(_DiffLit_3113500 = (_DiffLit_3113500 + (_tmpvar_3543543.xyz * ((_NoL_3513540 * _Atten_3493538) * _spot_3483537))));
}
(_diffLighting_23191 = _DiffLit_3113500);
(_OUT_143203.xyz = (_OUT_143203.xyz + _lighting_3123501));
(_OUT_143203.xyz = (_OUT_143203.xyz + (_DiffLit_3113500 * _DiffuseColor_53194)));
float _tmpvar_3663555 = {0};
(_tmpvar_3663555 = max(0.5, clamp((1.0 + (_shadow_83197 * 0.5)), 0.0, 1.0)));
(_OUT_143203.xyz = (_OUT_143203.xyz * _tmpvar_3663555));
float _tmpvar_3673556 = {0};
if ((_ReflectionPos.w < 0.0))
{
(_tmpvar_3673556 = ((-_ReflectionPos.w) - 1.0));
}
else
{
(_tmpvar_3673556 = 0.0);
}
float3 _tmpvar_3683557 = {0, 0, 0};
if ((_tmpvar_3673556 < 0.0))
{
(_tmpvar_3683557 = _ReflectionPos.xyz);
}
else
{
(_tmpvar_3683557 = _SunDirection.xyz);
}
float _tmpvar_3693558 = {0};
(_tmpvar_3693558 = clamp(dot((-_tmpvar_2473436), _tmpvar_3683557), 0.0, 1.0));
float _tmpvar_3703559 = {0};
(_tmpvar_3703559 = (1.0 - _xlv_TEXCOORD3.w));
(_OUT_143203.xyz = ((_OUT_143203.xyz * _tmpvar_3703559) + (((_OUT_143203.xyz * _tmpvar_3703559) + (((_FogColor2.xyz * clamp((exp(((15.0 * _tmpvar_2473436.y) - 1.5)) * 4.0), 0.0, 1.0)) + _FogColor.xyz) + (_FogColor3.xyz * (_tmpvar_3693558 * _tmpvar_3693558)))) * _xlv_TEXCOORD3.w)));
(_OUT_143203.xyz = (_OUT_143203.xyz * _EnvInfo.z));
(_OUT_143203.xyz = clamp(_OUT_143203.xyz, float3(0.0, 0.0, 0.0), float3(4.0, 4.0, 4.0)));
float3 _tmpvar_3713560 = {0, 0, 0};
(_tmpvar_3713560.x = _FogColor.w);
(_tmpvar_3713560.y = _FogColor2.w);
(_tmpvar_3713560.z = _FogColor3.w);
(_OUT_143203.xyz = (_OUT_143203.xyz * _tmpvar_3713560));
(_OUT_143203.xyz = (_OUT_143203.xyz / ((_OUT_143203.xyz * 0.9661836) + 0.180676)));
float _weight_3723561 = {0};
(_weight_3723561 = 0.0);
if ((_UserData[2].x <= -5.0))
{
(_weight_3723561 = (_UserData[2].x + 6.0));
}
else
{
if ((_UserData[2].x < -1e-06))
{
(_weight_3723561 = (-_UserData[2].x));
}
else
{
(_weight_3723561 = float_ctor(((clamp(_cGrayPencent, 0.0, 1.0) + _UserData[2].x) >= 2.0)));
}
}
(_OUT_143203.xyz = ((_OUT_143203.xyz * (1.0 - _weight_3723561)) + (_weight_3723561 * dot(_OUT_143203.xyz, float3(0.30000001, 0.58999997, 0.11)))));
float _tmpvar_3733562 = {0};
(_tmpvar_3733562 = clamp(((_OUT_3013490.w - 0.050000001) / 0.050000001), 0.0, 1.0));
(_OUT_143203.w = ((((floor((clamp(_OUT_3013490.w, 0.0, 1.0) * 63.0)) * 4.0) + clamp(ceil((dot(_OUT_143203.xyz, float3(0.30000001, 0.58999997, 0.11)) * _cNewBloomScale)), 0.0, 3.0)) / 255.0) * (_tmpvar_3733562 * (_tmpvar_3733562 * (3.0 - (2.0 * _tmpvar_3733562))))));
(_OUT_143203.xyz = (_OUT_143203.xyz * _OUT_143203.w));
(out_SV_Target = _OUT_143203);
return generateOutput();
}